package com.example.springssm.bean;

import jakarta.validation.constraints.*;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
@Data
public class Employee {
    private Long id;

    @NotBlank(message = "姓名不能为空")
    @Size(min = 2, max = 50, message = "姓名长度必须在2-50个字符之间")
    private String name;

    @NotNull(message = "性别不能为空")
    @Min(value = 0, message = "性别只能是0或1")
    @Max(value = 1, message = "性别只能是0或1")
    private Integer gender;

    @NotNull(message = "年龄不能为空")
    @Min(value = 18, message = "年龄必须大于或等于18岁")
    @Max(value = 65, message = "年龄必须小于或等于65岁")
    private Integer age;

    @NotBlank(message = "职位不能为空")
    private String position;

    @NotNull(message = "薪资不能为空")
    @DecimalMin(value = "0.0", inclusive = false, message = "薪资必须大于0")
    private BigDecimal salary;

    @NotNull(message = "入职日期不能为空")
    @PastOrPresent(message = "入职日期不能是未来日期")
    private Date hireDate;

    @NotBlank(message = "部门不能为空")
    private String department;
}
